//
//  XJHRefreshGifHeader.swift
//  PublicPod
//
//  Created by 许俊华 on 2021/9/7.
//

import UIKit
import MJRefresh

public class XJHRefreshGifHeader: MJRefreshGifHeader {

    public override func prepare() {
        super.prepare()
        // 设置普通状态的动画图片
        var idleImages:[UIImage] = [UIImage]()
        for index in 0...12 {
            let image:UIImage = UIImage(named: "") ?? UIImage()
            idleImages.append(image)
        }
        self.setImages(idleImages, for: MJRefreshState.idle)
        
        // 设置即将刷新状态的动画图片（一松开就会刷新的状态）]
        var refreshingImages:[UIImage] = [UIImage]()
        for index1 in 0...12 {
            let image:UIImage = UIImage(named: "") ?? UIImage()
            refreshingImages.append(image)
        }
        self.setImages(refreshingImages, for: MJRefreshState.pulling)
        
        // 设置正在刷新状态的动画图片
        self.setImages(refreshingImages, for: MJRefreshState.refreshing)
        
        //隐藏时间
        self.lastUpdatedTimeLabel?.isHidden = true
        //隐藏状态
        self.stateLabel?.isHidden = true
    }
    
    /*
    // Only override draw() if you perform custom drawing.
    // An empty implementation adversely affects performance during animation.
    override func draw(_ rect: CGRect) {
        // Drawing code
    }
    */

}
